Integrand size = 26, antiderivative size = 280 \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {2 i f (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} d^2}+\frac {2 i f (e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} d^2}-\frac {2 f^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} d^3}+\frac {2 f^2 \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b \sqrt {a^2-b^2} d^3}-\frac {(e+f x)^2}{b d (a+b \sin (c+d x))} \]
-(f*x+e)^2/b/d/(a+b*sin(d*x+c))-2*I*f*(f*x+e)*ln(1-I*b*exp(I*(d*x+c))/(a-( a^2-b^2)^(1/2)))/b/d^2/(a^2-b^2)^(1/2)+2*I*f*(f*x+e)*ln(1-I*b*exp(I*(d*x+c ))/(a+(a^2-b^2)^(1/2)))/b/d^2/(a^2-b^2)^(1/2)-2*f^2*polylog(2,I*b*exp(I*(d *x+c))/(a-(a^2-b^2)^(1/2)))/b/d^3/(a^2-b^2)^(1/2)+2*f^2*polylog(2,I*b*exp( I*(d*x+c))/(a+(a^2-b^2)^(1/2)))/b/d^3/(a^2-b^2)^(1/2)
Time = 2.14 (sec) , antiderivative size = 311, normalized size of antiderivative = 1.11 \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {2 i f \left (-i d \left (2 \sqrt {-a^2+b^2} e \arctan \left (\frac {i a+b e^{i (c+d x)}}{\sqrt {a^2-b^2}}\right )+\sqrt {a^2-b^2} f x \left (\log \left (1-\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-\log \left (1+\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )\right )\right )-\sqrt {a^2-b^2} f \operatorname {PolyLog}\left (2,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+\sqrt {a^2-b^2} f \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )\right )}{b \sqrt {-\left (a^2-b^2\right )^2} d^3}-\frac {(e+f x)^2}{b d (a+b \sin (c+d x))} \]
((2*I)*f*((-I)*d*(2*Sqrt[-a^2 + b^2]*e*ArcTan[(I*a + b*E^(I*(c + d*x)))/Sq rt[a^2 - b^2]] + Sqrt[a^2 - b^2]*f*x*(Log[1 - (b*E^(I*(c + d*x)))/((-I)*a + Sqrt[-a^2 + b^2])] - Log[1 + (b*E^(I*(c + d*x)))/(I*a + Sqrt[-a^2 + b^2] )])) - Sqrt[a^2 - b^2]*f*PolyLog[2, (b*E^(I*(c + d*x)))/((-I)*a + Sqrt[-a^ 2 + b^2])] + Sqrt[a^2 - b^2]*f*PolyLog[2, -((b*E^(I*(c + d*x)))/(I*a + Sqr t[-a^2 + b^2]))]))/(b*Sqrt[-(a^2 - b^2)^2]*d^3) - (e + f*x)^2/(b*d*(a + b* Sin[c + d*x]))
Time = 0.97 (sec) , antiderivative size = 272, normalized size of antiderivative = 0.97, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {4922, 3042, 3804, 2694, 27, 2620, 2715, 2838}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 4922 |
\(\displaystyle \frac {2 f \int \frac {e+f x}{a+b \sin (c+d x)}dx}{b d}-\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 f \int \frac {e+f x}{a+b \sin (c+d x)}dx}{b d}-\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}\) |
\(\Big \downarrow \) 3804 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \int \frac {e^{i (c+d x)} (e+f x)}{2 e^{i (c+d x)} a-i b e^{2 i (c+d x)}+i b}dx}{b d}\) |
\(\Big \downarrow \) 2694 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \left (\frac {i b \int \frac {e^{i (c+d x)} (e+f x)}{2 \left (a-i b e^{i (c+d x)}+\sqrt {a^2-b^2}\right )}dx}{\sqrt {a^2-b^2}}-\frac {i b \int \frac {e^{i (c+d x)} (e+f x)}{2 \left (a-i b e^{i (c+d x)}-\sqrt {a^2-b^2}\right )}dx}{\sqrt {a^2-b^2}}\right )}{b d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \left (\frac {i b \int \frac {e^{i (c+d x)} (e+f x)}{a-i b e^{i (c+d x)}+\sqrt {a^2-b^2}}dx}{2 \sqrt {a^2-b^2}}-\frac {i b \int \frac {e^{i (c+d x)} (e+f x)}{a-i b e^{i (c+d x)}-\sqrt {a^2-b^2}}dx}{2 \sqrt {a^2-b^2}}\right )}{b d}\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \left (\frac {i b \left (\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b d}-\frac {f \int \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )dx}{b d}\right )}{2 \sqrt {a^2-b^2}}-\frac {i b \left (\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b d}-\frac {f \int \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )dx}{b d}\right )}{2 \sqrt {a^2-b^2}}\right )}{b d}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \left (\frac {i b \left (\frac {i f \int e^{-i (c+d x)} \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )de^{i (c+d x)}}{b d^2}+\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b d}\right )}{2 \sqrt {a^2-b^2}}-\frac {i b \left (\frac {i f \int e^{-i (c+d x)} \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )de^{i (c+d x)}}{b d^2}+\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b d}\right )}{2 \sqrt {a^2-b^2}}\right )}{b d}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle -\frac {(e+f x)^2}{b d (a+b \sin (c+d x))}+\frac {4 f \left (\frac {i b \left (\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{\sqrt {a^2-b^2}+a}\right )}{b d}-\frac {i f \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{b d^2}\right )}{2 \sqrt {a^2-b^2}}-\frac {i b \left (\frac {(e+f x) \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b d}-\frac {i f \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{b d^2}\right )}{2 \sqrt {a^2-b^2}}\right )}{b d}\) |
(4*f*(((-1/2*I)*b*(((e + f*x)*Log[1 - (I*b*E^(I*(c + d*x)))/(a - Sqrt[a^2 - b^2])])/(b*d) - (I*f*PolyLog[2, (I*b*E^(I*(c + d*x)))/(a - Sqrt[a^2 - b^ 2])])/(b*d^2)))/Sqrt[a^2 - b^2] + ((I/2)*b*(((e + f*x)*Log[1 - (I*b*E^(I*( c + d*x)))/(a + Sqrt[a^2 - b^2])])/(b*d) - (I*f*PolyLog[2, (I*b*E^(I*(c + d*x)))/(a + Sqrt[a^2 - b^2])])/(b*d^2)))/Sqrt[a^2 - b^2]))/(b*d) - (e + f* x)^2/(b*d*(a + b*Sin[c + d*x]))
3.4.20.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[((F_)^(u_)*((f_.) + (g_.)*(x_))^(m_.))/((a_.) + (b_.)*(F_)^(u_) + (c_.) *(F_)^(v_)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[2*(c/q) Int [(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Simp[2*(c/q) Int[(f + g*x) ^m*(F^u/(b + q + 2*c*F^u)), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[ v, 2*u] && LinearQ[u, x] && NeQ[b^2 - 4*a*c, 0] && IGtQ[m, 0]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Sy mbol] :> Simp[2 Int[(c + d*x)^m*(E^(I*(e + f*x))/(I*b + 2*a*E^(I*(e + f*x )) - I*b*E^(2*I*(e + f*x)))), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ [a^2 - b^2, 0] && IGtQ[m, 0]
Int[Cos[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))^(m_.)*((a_) + (b_.)*Sin[(c _.) + (d_.)*(x_)])^(n_.), x_Symbol] :> Simp[(e + f*x)^m*((a + b*Sin[c + d*x ])^(n + 1)/(b*d*(n + 1))), x] - Simp[f*(m/(b*d*(n + 1))) Int[(e + f*x)^(m - 1)*(a + b*Sin[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && NeQ[n, -1]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 596 vs. \(2 (250 ) = 500\).
Time = 1.33 (sec) , antiderivative size = 597, normalized size of antiderivative = 2.13
method | result | size |
risch | \(-\frac {2 i \left (x^{2} f^{2}+2 f e x +e^{2}\right ) {\mathrm e}^{i \left (d x +c \right )}}{b d \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right )}+\frac {4 i f e \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{d^{2} b \sqrt {-a^{2}+b^{2}}}+\frac {2 f^{2} \ln \left (\frac {-i a -b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{-i a +\sqrt {-a^{2}+b^{2}}}\right ) x}{d^{2} b \sqrt {-a^{2}+b^{2}}}-\frac {2 f^{2} \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) x}{d^{2} b \sqrt {-a^{2}+b^{2}}}+\frac {2 f^{2} \ln \left (\frac {-i a -b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{-i a +\sqrt {-a^{2}+b^{2}}}\right ) c}{d^{3} b \sqrt {-a^{2}+b^{2}}}-\frac {2 f^{2} \ln \left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right ) c}{d^{3} b \sqrt {-a^{2}+b^{2}}}-\frac {2 i f^{2} \operatorname {dilog}\left (\frac {-i a -b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{-i a +\sqrt {-a^{2}+b^{2}}}\right )}{d^{3} b \sqrt {-a^{2}+b^{2}}}+\frac {2 i f^{2} \operatorname {dilog}\left (\frac {i a +b \,{\mathrm e}^{i \left (d x +c \right )}+\sqrt {-a^{2}+b^{2}}}{i a +\sqrt {-a^{2}+b^{2}}}\right )}{d^{3} b \sqrt {-a^{2}+b^{2}}}-\frac {4 i f^{2} c \arctan \left (\frac {2 i b \,{\mathrm e}^{i \left (d x +c \right )}-2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{d^{3} b \sqrt {-a^{2}+b^{2}}}\) | \(597\) |
-2*I*(f^2*x^2+2*e*f*x+e^2)*exp(I*(d*x+c))/b/d/(b*exp(2*I*(d*x+c))-b+2*I*a* exp(I*(d*x+c)))+4*I/d^2/b*f*e/(-a^2+b^2)^(1/2)*arctan(1/2*(2*I*b*exp(I*(d* x+c))-2*a)/(-a^2+b^2)^(1/2))+2/d^2/b*f^2/(-a^2+b^2)^(1/2)*ln((-I*a-b*exp(I *(d*x+c))+(-a^2+b^2)^(1/2))/(-I*a+(-a^2+b^2)^(1/2)))*x-2/d^2/b*f^2/(-a^2+b ^2)^(1/2)*ln((I*a+b*exp(I*(d*x+c))+(-a^2+b^2)^(1/2))/(I*a+(-a^2+b^2)^(1/2) ))*x+2/d^3/b*f^2/(-a^2+b^2)^(1/2)*ln((-I*a-b*exp(I*(d*x+c))+(-a^2+b^2)^(1/ 2))/(-I*a+(-a^2+b^2)^(1/2)))*c-2/d^3/b*f^2/(-a^2+b^2)^(1/2)*ln((I*a+b*exp( I*(d*x+c))+(-a^2+b^2)^(1/2))/(I*a+(-a^2+b^2)^(1/2)))*c-2*I/d^3/b*f^2/(-a^2 +b^2)^(1/2)*dilog((-I*a-b*exp(I*(d*x+c))+(-a^2+b^2)^(1/2))/(-I*a+(-a^2+b^2 )^(1/2)))+2*I/d^3/b*f^2/(-a^2+b^2)^(1/2)*dilog((I*a+b*exp(I*(d*x+c))+(-a^2 +b^2)^(1/2))/(I*a+(-a^2+b^2)^(1/2)))-4*I/d^3/b*f^2*c/(-a^2+b^2)^(1/2)*arct an(1/2*(2*I*b*exp(I*(d*x+c))-2*a)/(-a^2+b^2)^(1/2))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1393 vs. \(2 (242) = 484\).
Time = 0.39 (sec) , antiderivative size = 1393, normalized size of antiderivative = 4.98 \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Too large to display} \]
-((a^2 - b^2)*d^2*f^2*x^2 + 2*(a^2 - b^2)*d^2*e*f*x + (a^2 - b^2)*d^2*e^2 + (-I*b^2*f^2*sin(d*x + c) - I*a*b*f^2)*sqrt(-(a^2 - b^2)/b^2)*dilog((I*a* cos(d*x + c) - a*sin(d*x + c) + (b*cos(d*x + c) + I*b*sin(d*x + c))*sqrt(- (a^2 - b^2)/b^2) - b)/b + 1) + (I*b^2*f^2*sin(d*x + c) + I*a*b*f^2)*sqrt(- (a^2 - b^2)/b^2)*dilog((I*a*cos(d*x + c) - a*sin(d*x + c) - (b*cos(d*x + c ) + I*b*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2) - b)/b + 1) + (I*b^2*f^2*sin( d*x + c) + I*a*b*f^2)*sqrt(-(a^2 - b^2)/b^2)*dilog((-I*a*cos(d*x + c) - a* sin(d*x + c) + (b*cos(d*x + c) - I*b*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2) - b)/b + 1) + (-I*b^2*f^2*sin(d*x + c) - I*a*b*f^2)*sqrt(-(a^2 - b^2)/b^2) *dilog((-I*a*cos(d*x + c) - a*sin(d*x + c) - (b*cos(d*x + c) - I*b*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2) - b)/b + 1) - (a*b*d*e*f - a*b*c*f^2 + (b^2* d*e*f - b^2*c*f^2)*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2)*log(2*b*cos(d*x + c) + 2*I*b*sin(d*x + c) + 2*b*sqrt(-(a^2 - b^2)/b^2) + 2*I*a) - (a*b*d*e*f - a*b*c*f^2 + (b^2*d*e*f - b^2*c*f^2)*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2 )*log(2*b*cos(d*x + c) - 2*I*b*sin(d*x + c) + 2*b*sqrt(-(a^2 - b^2)/b^2) - 2*I*a) + (a*b*d*e*f - a*b*c*f^2 + (b^2*d*e*f - b^2*c*f^2)*sin(d*x + c))*s qrt(-(a^2 - b^2)/b^2)*log(-2*b*cos(d*x + c) + 2*I*b*sin(d*x + c) + 2*b*sqr t(-(a^2 - b^2)/b^2) + 2*I*a) + (a*b*d*e*f - a*b*c*f^2 + (b^2*d*e*f - b^2*c *f^2)*sin(d*x + c))*sqrt(-(a^2 - b^2)/b^2)*log(-2*b*cos(d*x + c) - 2*I*b*s in(d*x + c) + 2*b*sqrt(-(a^2 - b^2)/b^2) - 2*I*a) + (a*b*d*f^2*x + a*b*...
Timed out. \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Timed out} \]
Exception generated. \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
\[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \cos \left (d x + c\right )}{{\left (b \sin \left (d x + c\right ) + a\right )}^{2}} \,d x } \]
Timed out. \[ \int \frac {(e+f x)^2 \cos (c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Hanged} \]